/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.siga.modelo.entidad;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author karolyn
 */
@Entity
@Table(name = "Semestre")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Semestre.findAll", query = "SELECT s FROM Semestre s"),
    @NamedQuery(name = "Semestre.findByCodSemestre", query = "SELECT s FROM Semestre s WHERE s.codSemestre = :codSemestre"),
    @NamedQuery(name = "Semestre.findByFecInicio", query = "SELECT s FROM Semestre s WHERE s.fecInicio = :fecInicio"),
    @NamedQuery(name = "Semestre.findByFecFin", query = "SELECT s FROM Semestre s WHERE s.fecFin = :fecFin"),
    @NamedQuery(name = "Semestre.findByVigente", query = "SELECT s FROM Semestre s WHERE s.vigente = :vigente")})
public class Semestre implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "codSemestre")
    private String codSemestre;
    @Column(name = "fecInicio")
    private String fecInicio;
    @Column(name = "fecFin")
    private String fecFin;
    @Column(name = "vigente")
    private Boolean vigente;
    @OneToMany(mappedBy = "codSemestre")
    private Collection<Programacion> programacionCollection;

    public Semestre() {
    }

    public Semestre(String codSemestre) {
        this.codSemestre = codSemestre;
    }

    public String getCodSemestre() {
        return codSemestre;
    }

    public void setCodSemestre(String codSemestre) {
        this.codSemestre = codSemestre;
    }

    public String getFecInicio() {
        return fecInicio;
    }

    public void setFecInicio(String fecInicio) {
        this.fecInicio = fecInicio;
    }

    public String getFecFin() {
        return fecFin;
    }

    public void setFecFin(String fecFin) {
        this.fecFin = fecFin;
    }

    public Boolean getVigente() {
        return vigente;
    }

    public void setVigente(Boolean vigente) {
        this.vigente = vigente;
    }

    @XmlTransient
    public Collection<Programacion> getProgramacionCollection() {
        return programacionCollection;
    }

    public void setProgramacionCollection(Collection<Programacion> programacionCollection) {
        this.programacionCollection = programacionCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codSemestre != null ? codSemestre.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Semestre)) {
            return false;
        }
        Semestre other = (Semestre) object;
        if ((this.codSemestre == null && other.codSemestre != null) || (this.codSemestre != null && !this.codSemestre.equals(other.codSemestre))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.siga.modelo.entidad.Semestre[ codSemestre=" + codSemestre + " ]";
    }
    
}
